package models

import (
	"time"
)

// MaEmergency [...]
type MaEmergency struct {
	ID                int       `gorm:"autoIncrement:true;primaryKey;column:id;type:int;not null"  json:"id" json_old:"ID"`
	SalesID           string    `gorm:"column:sales_id;type:varchar(50);not null;comment:机器唯一识别ID"  json:"sales_id" json_old:"SalesID"`
	Type              int       `gorm:"column:type;type:int;not null;comment:三级告警类型(一级和二级不需要存入)：1001.退款 1002低库存 1003 系统异常 1004 关舱超时 1005 初始化报错"  json:"type" json_old:"Type"`
	AddTime           time.Time `gorm:"column:add_time;type:datetime;not null;comment:添加时间"  json:"add_time" json_old:"AddTime"`
	EmergencyUserInfo string    `gorm:"column:emergency_user_info;type:varchar(255);not null;comment:通知人名称"  json:"emergency_user_info" json_old:"EmergencyUserInfo"`
	Deleted           int       `gorm:"column:deleted;type:tinyint(1);not null;default:0;comment:1删除 0正常"  json:"deleted" json_old:"Deleted"`
	CreatedAt         int64     `gorm:"column:created_at;autoCreateTime;type:int;size:64;comment:创建时间" json:"created_at"`
}

// TableName get sql table name.获取数据库表名
func (m MaEmergency) TableName() string {
	return "ma_emergency"
}

// 模式自动注册
func init() {
	Models = append(Models, &MaEmergency{})
}
